home *** CD-ROM | disk | FTP | other *** search
/ FM Towns: Free Software Collection 7 / FM Towns Free Software Collection 7.iso / t_os / gpen32k / source.exe / LSRC / SPLITPAT.C < prev   
Text File  |  1993-03-24  |  472b  |  30 lines

  1. /*    High-C互換ライブラリ    */
  2.  
  3. #include <string.h>
  4.  
  5. void _splitpath( char *path, char *drv, char *dir, char *fn, char *ext)
  6. {
  7.     char a[200];
  8.     char *tmp;
  9.     int j=0;
  10.     strcpy(a, path);
  11.     while (strpbrk(path, ":")!=NULL)
  12.     {
  13.         drv[j++] = *(path++);
  14.     }
  15.     drv[j] = 0;
  16.     j = 0;
  17.     while (strpbrk(path, "\\")!=NULL)
  18.     {
  19.         dir[j++] = *(path++);
  20.     }
  21.     dir[j] = 0;
  22.     j = 0;
  23.     while (*path!='.' && *path!=0)
  24.     {
  25.         fn[j++] = *(path++);
  26.     }
  27.     fn[j] = 0;
  28.     strcpy(ext,path);
  29. }
  30.